package com.github.postsanf.yinian.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.github.postsanf.yinian.R;

public class CourseActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_course);
        initView();
    }

    private void initView() {
        ImageView iv_back = (ImageView) findViewById(R.id.iv_back);
        iv_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        TextView tv_title = (TextView) findViewById(R.id.tv_title);
        TextView tv_question = (TextView) findViewById(R.id.tv_question);
        TextView tv_answer = (TextView) findViewById(R.id.tv_answer);
        String title = getIntent().getStringExtra("title");
        String question = getIntent().getStringExtra("question");
        String answer = getIntent().getStringExtra("answer");
        tv_title.setText(title);
        tv_question.setText(question);
        tv_answer.setText(answer);
    }
}
